<html>
<head>
  <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=ISO-8859-1">
  <title>Contents.m</title>
<link rel="stylesheet" type="text/css" href="../stpr.css">
</head>
<body>
<table  border=0 width="100%" cellpadding=0 cellspacing=0><tr valign="baseline">
<td valign="baseline" class="function"><b class="function">DSAMP</b>
<td valign="baseline" align="right" class="function"><a href="../probab/index.html" target="mdsdir"><img border = 0 src="../up.gif"></a></table>
  <p><b>Generates samples from discrete distribution.</b></p>
  <hr>
<div class='code'><code>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Synopsis:</span></span><br>
<span class=help>&nbsp;&nbsp;X&nbsp;=&nbsp;dsamp(Px,num_data)</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Input:</span></span><br>
<span class=help>&nbsp;&nbsp;Px&nbsp;[dim&nbsp;x&nbsp;1]&nbsp;Discrete&nbsp;probability&nbsp;distribution;&nbsp;it&nbsp;must</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;satisfy&nbsp;sum(Px)&nbsp;=&nbsp;1&nbsp;and&nbsp;min(Px)&nbsp;&gt;=&nbsp;0.</span><br>
<span class=help>&nbsp;&nbsp;num_data&nbsp;[1&nbsp;x&nbsp;1]&nbsp;Number&nbsp;of&nbsp;samples&nbsp;to&nbsp;be&nbsp;generated.</span><br>
<span class=help>&nbsp;</span><br>
<span class=help>&nbsp;<span class=help_field>Example:</span></span><br>
<span class=help>&nbsp;&nbsp;Px&nbsp;=&nbsp;[0.2&nbsp;0.3&nbsp;0.1&nbsp;0.4];</span><br>
<span class=help>&nbsp;&nbsp;X&nbsp;=&nbsp;dsamp(Px,1000);</span><br>
<span class=help>&nbsp;&nbsp;Px_emp&nbsp;=&nbsp;hist(X,4)/1000</span><br>
<span class=help></span><br>
<span class=help>&nbsp;See&nbsp;also</span><br>
<span class=help>&nbsp;&nbsp;GSAMP,&nbsp;GMMSAMP</span><br>
</code></div>
  <hr>
  <b>Source:</b> <a href= "../probab/list/dsamp.html">dsamp.m</a>
  <p><b class="info_field">About: </b>  Statistical Pattern Recognition Toolbox<br>
 (C) 1999-2005, Written by Vojtech Franc and Vaclav Hlavac<br>
 Czech Technical University Prague<br>
 Faculty of Electrical Engineering<br>
 Center for Machine Perception<br>

  <p><b class="info_field">Modifications: </b> <br>
 26-mar-2005, VF<br>

</body>
</html>
